Violent Discipline Against Children: A Global Analysis for Action and Change

Author

Shantanu Desai

Published

2024-04-26

Code
!pip install quarto-cli
Requirement already satisfied: quarto-cli in /usr/local/lib/python3.11/dist-packages (1.6.42)
Requirement already satisfied: jupyter in /usr/local/lib/python3.11/dist-packages (from quarto-cli) (1.1.1)
Requirement already satisfied: nbclient in /usr/local/lib/python3.11/dist-packages (from quarto-cli) (0.10.2)
Requirement already satisfied: wheel in /usr/local/lib/python3.11/dist-packages (from quarto-cli) (0.45.1)
Requirement already satisfied: notebook in /usr/local/lib/python3.11/dist-packages (from jupyter->quarto-cli) (6.5.7)
Requirement already satisfied: jupyter-console in /usr/local/lib/python3.11/dist-packages (from jupyter->quarto-cli) (6.1.0)
Requirement already satisfied: nbconvert in /usr/local/lib/python3.11/dist-packages (from jupyter->quarto-cli) (7.16.6)
Requirement already satisfied: ipykernel in /usr/local/lib/python3.11/dist-packages (from jupyter->quarto-cli) (6.17.1)
Requirement already satisfied: ipywidgets in /usr/local/lib/python3.11/dist-packages (from jupyter->quarto-cli) (7.7.1)
Requirement already satisfied: jupyterlab in /usr/local/lib/python3.11/dist-packages (from jupyter->quarto-cli) (4.4.1)
Requirement already satisfied: jupyter-client>=6.1.12 in /usr/local/lib/python3.11/dist-packages (from nbclient->quarto-cli) (7.4.9)
Requirement already satisfied: jupyter-core!=5.0.*,>=4.12 in /usr/local/lib/python3.11/dist-packages (from nbclient->quarto-cli) (5.7.2)
Requirement already satisfied: nbformat>=5.1 in /usr/local/lib/python3.11/dist-packages (from nbclient->quarto-cli) (5.10.4)
Requirement already satisfied: traitlets>=5.4 in /usr/local/lib/python3.11/dist-packages (from nbclient->quarto-cli) (5.7.1)
Requirement already satisfied: entrypoints in /usr/local/lib/python3.11/dist-packages (from jupyter-client>=6.1.12->nbclient->quarto-cli) (0.4)
Requirement already satisfied: nest-asyncio>=1.5.4 in /usr/local/lib/python3.11/dist-packages (from jupyter-client>=6.1.12->nbclient->quarto-cli) (1.6.0)
Requirement already satisfied: python-dateutil>=2.8.2 in /usr/local/lib/python3.11/dist-packages (from jupyter-client>=6.1.12->nbclient->quarto-cli) (2.8.2)
Requirement already satisfied: pyzmq>=23.0 in /usr/local/lib/python3.11/dist-packages (from jupyter-client>=6.1.12->nbclient->quarto-cli) (24.0.1)
Requirement already satisfied: tornado>=6.2 in /usr/local/lib/python3.11/dist-packages (from jupyter-client>=6.1.12->nbclient->quarto-cli) (6.4.2)
Requirement already satisfied: platformdirs>=2.5 in /usr/local/lib/python3.11/dist-packages (from jupyter-core!=5.0.*,>=4.12->nbclient->quarto-cli) (4.3.7)
Requirement already satisfied: fastjsonschema>=2.15 in /usr/local/lib/python3.11/dist-packages (from nbformat>=5.1->nbclient->quarto-cli) (2.21.1)
Requirement already satisfied: jsonschema>=2.6 in /usr/local/lib/python3.11/dist-packages (from nbformat>=5.1->nbclient->quarto-cli) (4.23.0)
Requirement already satisfied: debugpy>=1.0 in /usr/local/lib/python3.11/dist-packages (from ipykernel->jupyter->quarto-cli) (1.8.0)
Requirement already satisfied: ipython>=7.23.1 in /usr/local/lib/python3.11/dist-packages (from ipykernel->jupyter->quarto-cli) (7.34.0)
Requirement already satisfied: matplotlib-inline>=0.1 in /usr/local/lib/python3.11/dist-packages (from ipykernel->jupyter->quarto-cli) (0.1.7)
Requirement already satisfied: packaging in /usr/local/lib/python3.11/dist-packages (from ipykernel->jupyter->quarto-cli) (24.2)
Requirement already satisfied: psutil in /usr/local/lib/python3.11/dist-packages (from ipykernel->jupyter->quarto-cli) (5.9.5)
Requirement already satisfied: ipython-genutils~=0.2.0 in /usr/local/lib/python3.11/dist-packages (from ipywidgets->jupyter->quarto-cli) (0.2.0)
Requirement already satisfied: widgetsnbextension~=3.6.0 in /usr/local/lib/python3.11/dist-packages (from ipywidgets->jupyter->quarto-cli) (3.6.10)
Requirement already satisfied: jupyterlab-widgets>=1.0.0 in /usr/local/lib/python3.11/dist-packages (from ipywidgets->jupyter->quarto-cli) (3.0.14)
Requirement already satisfied: prompt-toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0 in /usr/local/lib/python3.11/dist-packages (from jupyter-console->jupyter->quarto-cli) (3.0.51)
Requirement already satisfied: pygments in /usr/local/lib/python3.11/dist-packages (from jupyter-console->jupyter->quarto-cli) (2.18.0)
Requirement already satisfied: async-lru>=1.0.0 in /usr/local/lib/python3.11/dist-packages (from jupyterlab->jupyter->quarto-cli) (2.0.5)
Requirement already satisfied: httpx>=0.25.0 in /usr/local/lib/python3.11/dist-packages (from jupyterlab->jupyter->quarto-cli) (0.28.1)
Requirement already satisfied: jinja2>=3.0.3 in /usr/local/lib/python3.11/dist-packages (from jupyterlab->jupyter->quarto-cli) (3.1.6)
Requirement already satisfied: jupyter-lsp>=2.0.0 in /usr/local/lib/python3.11/dist-packages (from jupyterlab->jupyter->quarto-cli) (2.2.5)
Requirement already satisfied: jupyter-server<3,>=2.4.0 in /usr/local/lib/python3.11/dist-packages (from jupyterlab->jupyter->quarto-cli) (2.15.0)
Requirement already satisfied: jupyterlab-server<3,>=2.27.1 in /usr/local/lib/python3.11/dist-packages (from jupyterlab->jupyter->quarto-cli) (2.27.3)
Requirement already satisfied: notebook-shim>=0.2 in /usr/local/lib/python3.11/dist-packages (from jupyterlab->jupyter->quarto-cli) (0.2.4)
Requirement already satisfied: setuptools>=41.1.0 in /usr/local/lib/python3.11/dist-packages (from jupyterlab->jupyter->quarto-cli) (75.2.0)
Requirement already satisfied: beautifulsoup4 in /usr/local/lib/python3.11/dist-packages (from nbconvert->jupyter->quarto-cli) (4.13.4)
Requirement already satisfied: bleach!=5.0.0 in /usr/local/lib/python3.11/dist-packages (from bleach[css]!=5.0.0->nbconvert->jupyter->quarto-cli) (6.2.0)
Requirement already satisfied: defusedxml in /usr/local/lib/python3.11/dist-packages (from nbconvert->jupyter->quarto-cli) (0.7.1)
Requirement already satisfied: jupyterlab-pygments in /usr/local/lib/python3.11/dist-packages (from nbconvert->jupyter->quarto-cli) (0.3.0)
Requirement already satisfied: markupsafe>=2.0 in /usr/local/lib/python3.11/dist-packages (from nbconvert->jupyter->quarto-cli) (3.0.2)
Requirement already satisfied: mistune<4,>=2.0.3 in /usr/local/lib/python3.11/dist-packages (from nbconvert->jupyter->quarto-cli) (3.1.3)
Requirement already satisfied: pandocfilters>=1.4.1 in /usr/local/lib/python3.11/dist-packages (from nbconvert->jupyter->quarto-cli) (1.5.1)
Requirement already satisfied: argon2-cffi in /usr/local/lib/python3.11/dist-packages (from notebook->jupyter->quarto-cli) (23.1.0)
Requirement already satisfied: Send2Trash>=1.8.0 in /usr/local/lib/python3.11/dist-packages (from notebook->jupyter->quarto-cli) (1.8.3)
Requirement already satisfied: terminado>=0.8.3 in /usr/local/lib/python3.11/dist-packages (from notebook->jupyter->quarto-cli) (0.18.1)
Requirement already satisfied: prometheus-client in /usr/local/lib/python3.11/dist-packages (from notebook->jupyter->quarto-cli) (0.21.1)
Requirement already satisfied: nbclassic>=0.4.7 in /usr/local/lib/python3.11/dist-packages (from notebook->jupyter->quarto-cli) (1.2.0)
Requirement already satisfied: webencodings in /usr/local/lib/python3.11/dist-packages (from bleach!=5.0.0->bleach[css]!=5.0.0->nbconvert->jupyter->quarto-cli) (0.5.1)
Requirement already satisfied: tinycss2<1.5,>=1.1.0 in /usr/local/lib/python3.11/dist-packages (from bleach[css]!=5.0.0->nbconvert->jupyter->quarto-cli) (1.4.0)
Requirement already satisfied: anyio in /usr/local/lib/python3.11/dist-packages (from httpx>=0.25.0->jupyterlab->jupyter->quarto-cli) (4.9.0)
Requirement already satisfied: certifi in /usr/local/lib/python3.11/dist-packages (from httpx>=0.25.0->jupyterlab->jupyter->quarto-cli) (2025.1.31)
Requirement already satisfied: httpcore==1.* in /usr/local/lib/python3.11/dist-packages (from httpx>=0.25.0->jupyterlab->jupyter->quarto-cli) (1.0.8)
Requirement already satisfied: idna in /usr/local/lib/python3.11/dist-packages (from httpx>=0.25.0->jupyterlab->jupyter->quarto-cli) (3.10)
Requirement already satisfied: h11<0.15,>=0.13 in /usr/local/lib/python3.11/dist-packages (from httpcore==1.*->httpx>=0.25.0->jupyterlab->jupyter->quarto-cli) (0.14.0)
Requirement already satisfied: jedi>=0.16 in /usr/local/lib/python3.11/dist-packages (from ipython>=7.23.1->ipykernel->jupyter->quarto-cli) (0.19.2)
Requirement already satisfied: decorator in /usr/local/lib/python3.11/dist-packages (from ipython>=7.23.1->ipykernel->jupyter->quarto-cli) (4.4.2)
Requirement already satisfied: pickleshare in /usr/local/lib/python3.11/dist-packages (from ipython>=7.23.1->ipykernel->jupyter->quarto-cli) (0.7.5)
Requirement already satisfied: backcall in /usr/local/lib/python3.11/dist-packages (from ipython>=7.23.1->ipykernel->jupyter->quarto-cli) (0.2.0)
Requirement already satisfied: pexpect>4.3 in /usr/local/lib/python3.11/dist-packages (from ipython>=7.23.1->ipykernel->jupyter->quarto-cli) (4.9.0)
Requirement already satisfied: attrs>=22.2.0 in /usr/local/lib/python3.11/dist-packages (from jsonschema>=2.6->nbformat>=5.1->nbclient->quarto-cli) (25.3.0)
Requirement already satisfied: jsonschema-specifications>=2023.03.6 in /usr/local/lib/python3.11/dist-packages (from jsonschema>=2.6->nbformat>=5.1->nbclient->quarto-cli) (2024.10.1)
Requirement already satisfied: referencing>=0.28.4 in /usr/local/lib/python3.11/dist-packages (from jsonschema>=2.6->nbformat>=5.1->nbclient->quarto-cli) (0.36.2)
Requirement already satisfied: rpds-py>=0.7.1 in /usr/local/lib/python3.11/dist-packages (from jsonschema>=2.6->nbformat>=5.1->nbclient->quarto-cli) (0.24.0)
Requirement already satisfied: jupyter-events>=0.11.0 in /usr/local/lib/python3.11/dist-packages (from jupyter-server<3,>=2.4.0->jupyterlab->jupyter->quarto-cli) (0.12.0)
Requirement already satisfied: jupyter-server-terminals>=0.4.4 in /usr/local/lib/python3.11/dist-packages (from jupyter-server<3,>=2.4.0->jupyterlab->jupyter->quarto-cli) (0.5.3)
Requirement already satisfied: overrides>=5.0 in /usr/local/lib/python3.11/dist-packages (from jupyter-server<3,>=2.4.0->jupyterlab->jupyter->quarto-cli) (7.7.0)
Requirement already satisfied: websocket-client>=1.7 in /usr/local/lib/python3.11/dist-packages (from jupyter-server<3,>=2.4.0->jupyterlab->jupyter->quarto-cli) (1.8.0)
Requirement already satisfied: argon2-cffi-bindings in /usr/local/lib/python3.11/dist-packages (from argon2-cffi->notebook->jupyter->quarto-cli) (21.2.0)
Requirement already satisfied: babel>=2.10 in /usr/local/lib/python3.11/dist-packages (from jupyterlab-server<3,>=2.27.1->jupyterlab->jupyter->quarto-cli) (2.17.0)
Requirement already satisfied: json5>=0.9.0 in /usr/local/lib/python3.11/dist-packages (from jupyterlab-server<3,>=2.27.1->jupyterlab->jupyter->quarto-cli) (0.12.0)
Requirement already satisfied: requests>=2.31 in /usr/local/lib/python3.11/dist-packages (from jupyterlab-server<3,>=2.27.1->jupyterlab->jupyter->quarto-cli) (2.32.3)
Requirement already satisfied: wcwidth in /usr/local/lib/python3.11/dist-packages (from prompt-toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0->jupyter-console->jupyter->quarto-cli) (0.2.13)
Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.11/dist-packages (from python-dateutil>=2.8.2->jupyter-client>=6.1.12->nbclient->quarto-cli) (1.17.0)
Requirement already satisfied: ptyprocess in /usr/local/lib/python3.11/dist-packages (from terminado>=0.8.3->notebook->jupyter->quarto-cli) (0.7.0)
Requirement already satisfied: soupsieve>1.2 in /usr/local/lib/python3.11/dist-packages (from beautifulsoup4->nbconvert->jupyter->quarto-cli) (2.7)
Requirement already satisfied: typing-extensions>=4.0.0 in /usr/local/lib/python3.11/dist-packages (from beautifulsoup4->nbconvert->jupyter->quarto-cli) (4.13.2)
Requirement already satisfied: sniffio>=1.1 in /usr/local/lib/python3.11/dist-packages (from anyio->httpx>=0.25.0->jupyterlab->jupyter->quarto-cli) (1.3.1)
Requirement already satisfied: parso<0.9.0,>=0.8.4 in /usr/local/lib/python3.11/dist-packages (from jedi>=0.16->ipython>=7.23.1->ipykernel->jupyter->quarto-cli) (0.8.4)
Requirement already satisfied: python-json-logger>=2.0.4 in /usr/local/lib/python3.11/dist-packages (from jupyter-events>=0.11.0->jupyter-server<3,>=2.4.0->jupyterlab->jupyter->quarto-cli) (3.3.0)
Requirement already satisfied: pyyaml>=5.3 in /usr/local/lib/python3.11/dist-packages (from jupyter-events>=0.11.0->jupyter-server<3,>=2.4.0->jupyterlab->jupyter->quarto-cli) (6.0.2)
Requirement already satisfied: rfc3339-validator in /usr/local/lib/python3.11/dist-packages (from jupyter-events>=0.11.0->jupyter-server<3,>=2.4.0->jupyterlab->jupyter->quarto-cli) (0.1.4)
Requirement already satisfied: rfc3986-validator>=0.1.1 in /usr/local/lib/python3.11/dist-packages (from jupyter-events>=0.11.0->jupyter-server<3,>=2.4.0->jupyterlab->jupyter->quarto-cli) (0.1.1)
Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.11/dist-packages (from requests>=2.31->jupyterlab-server<3,>=2.27.1->jupyterlab->jupyter->quarto-cli) (3.4.1)
Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.11/dist-packages (from requests>=2.31->jupyterlab-server<3,>=2.27.1->jupyterlab->jupyter->quarto-cli) (2.3.0)
Requirement already satisfied: cffi>=1.0.1 in /usr/local/lib/python3.11/dist-packages (from argon2-cffi-bindings->argon2-cffi->notebook->jupyter->quarto-cli) (1.17.1)
Requirement already satisfied: pycparser in /usr/local/lib/python3.11/dist-packages (from cffi>=1.0.1->argon2-cffi-bindings->argon2-cffi->notebook->jupyter->quarto-cli) (2.22)
Requirement already satisfied: fqdn in /usr/local/lib/python3.11/dist-packages (from jsonschema[format-nongpl]>=4.18.0->jupyter-events>=0.11.0->jupyter-server<3,>=2.4.0->jupyterlab->jupyter->quarto-cli) (1.5.1)
Requirement already satisfied: isoduration in /usr/local/lib/python3.11/dist-packages (from jsonschema[format-nongpl]>=4.18.0->jupyter-events>=0.11.0->jupyter-server<3,>=2.4.0->jupyterlab->jupyter->quarto-cli) (20.11.0)
Requirement already satisfied: jsonpointer>1.13 in /usr/local/lib/python3.11/dist-packages (from jsonschema[format-nongpl]>=4.18.0->jupyter-events>=0.11.0->jupyter-server<3,>=2.4.0->jupyterlab->jupyter->quarto-cli) (3.0.0)
Requirement already satisfied: uri-template in /usr/local/lib/python3.11/dist-packages (from jsonschema[format-nongpl]>=4.18.0->jupyter-events>=0.11.0->jupyter-server<3,>=2.4.0->jupyterlab->jupyter->quarto-cli) (1.3.0)
Requirement already satisfied: webcolors>=24.6.0 in /usr/local/lib/python3.11/dist-packages (from jsonschema[format-nongpl]>=4.18.0->jupyter-events>=0.11.0->jupyter-server<3,>=2.4.0->jupyterlab->jupyter->quarto-cli) (24.11.1)
Requirement already satisfied: arrow>=0.15.0 in /usr/local/lib/python3.11/dist-packages (from isoduration->jsonschema[format-nongpl]>=4.18.0->jupyter-events>=0.11.0->jupyter-server<3,>=2.4.0->jupyterlab->jupyter->quarto-cli) (1.3.0)
Requirement already satisfied: types-python-dateutil>=2.8.10 in /usr/local/lib/python3.11/dist-packages (from arrow>=0.15.0->isoduration->jsonschema[format-nongpl]>=4.18.0->jupyter-events>=0.11.0->jupyter-server<3,>=2.4.0->jupyterlab->jupyter->quarto-cli) (2.9.0.20241206)
Code
!quarto render "/content/drive/MyDrive/Colab Notebooks/Quarto_project.ipynb"

Screenshot 2025-04-27 at 12.27.49 PM.png

#Introduction

Violent discipline remains a deeply concerning form of child abuse across the globe, affecting millions of children in ways that are both physical and psychological. Despite global efforts to protect children’s rights and improve their well-being, violent forms of punishment continue to be prevalent across regions, cultures, and economies.

This project, using a rich dataset from UNICEF, aims to explore the extent of violent discipline practices worldwide through compelling visual narratives. By analyzing patterns, understanding the socio-economic factors associated with these behaviors, and highlighting countries most in need of intervention, the project seeks to drive awareness and advocate for immediate action. Through powerful visual storytelling, this report brings visibility to a hidden crisis that demands urgent and sustained global attention.

Code
# Install plotnine and geopandas
!pip install plotnine geopandas

# Imports
import pandas as pd
import geopandas as gpd
from plotnine import *
import matplotlib.pyplot as plt
Code
from google.colab import files

# Upload CSV files
uploaded = files.upload()
Upload widget is only available when the cell has been executed in the current browser session. Please rerun this cell to enable.
Saving unicef_indicator_1.csv to unicef_indicator_1.csv
Code
from google.colab import files

# Upload CSV files
uploaded = files.upload()
Upload widget is only available when the cell has been executed in the current browser session. Please rerun this cell to enable.
Saving unicef_metadata.csv to unicef_metadata.csv
Code
# Read data
indicator = pd.read_csv('unicef_indicator_1.csv')
metadata = pd.read_csv('unicef_metadata.csv')

# Merge metadata (to get region or income group if needed)
df = pd.merge(indicator, metadata, on='country', how='left')
Code
!wget https://naciscdn.org/naturalearth/110m/cultural/ne_110m_admin_0_countries.zip
--2025-04-27 12:29:02--  https://naciscdn.org/naturalearth/110m/cultural/ne_110m_admin_0_countries.zip
Resolving naciscdn.org (naciscdn.org)... 18.160.249.3, 18.160.249.10, 18.160.249.57, ...
Connecting to naciscdn.org (naciscdn.org)|18.160.249.3|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 214976 (210K) [application/zip]
Saving to: ‘ne_110m_admin_0_countries.zip.1’

          ne_110m_a   0%[                    ]       0  --.-KB/s               ne_110m_admin_0_cou 100%[===================>] 209.94K  --.-KB/s    in 0.04s   

2025-04-27 12:29:02 (5.28 MB/s) - ‘ne_110m_admin_0_countries.zip.1’ saved [214976/214976]
Code
import geopandas as gpd
import pandas as pd
from plotnine import *

# Load the shapefile (world map)
world = gpd.read_file('ne_110m_admin_0_countries.shp')

# Load your UNICEF data
indicator = pd.read_csv('unicef_indicator_1.csv')

# Merge based on country name
world = world.merge(indicator, how='left', left_on='NAME', right_on='country')

#World Map (Global Prevalence)

The world map reveals the widespread nature of violent discipline, with darker regions showing higher rates. No continent is untouched. Hotspots emerge clearly across Sub-Saharan Africa, South Asia, and Latin America. This visualization powerfully demonstrates that violence against children remains a global issue, demanding coordinated international efforts for protection and prevention.

Code
import geopandas as gpd
import pandas as pd
import matplotlib.pyplot as plt

# Load world shapefile
world = gpd.read_file('ne_110m_admin_0_countries.shp')

# Load your UNICEF indicator data
indicator = pd.read_csv('unicef_indicator_1.csv')

# Merge based on country name
world = world.merge(indicator, how='left', left_on='NAME', right_on='country')

# Plot World Map using GeoPandas directly
fig, ax = plt.subplots(1, 1, figsize=(28, 8))

world.plot(column='obs_value',
           cmap='OrRd',
           linewidth=0.8,
           ax=ax,
           edgecolor='0.7',
           legend=True)

ax.set_title('World Map: % of Children Experiencing Violent Discipline', fontdict={'fontsize': 20})
plt.axis('off')
plt.show()

#Bar Chart

The bar chart starkly highlights countries where violent discipline is most severe. In several nations, more than 80% of children endure violent discipline at home or in their communities. These high rates signal urgent need for focused intervention, legal reforms, and national awareness programs to protect children from culturally normalized violence.

Code
import pandas as pd
import matplotlib.pyplot as plt

# Load dataset
indicator = pd.read_csv('unicef_indicator_1.csv')

# Filter only 2019 data
filtered_data = indicator[indicator['time_period'] == 2019]

# Drop missing observation values
filtered_data = filtered_data.dropna(subset=['obs_value'])

# Aggregate (just in case multiple entries per country)
filtered_data = filtered_data.groupby('country')['obs_value'].mean().reset_index()

# Sort by highest values (optional: looks cleaner)
filtered_data = filtered_data.sort_values(by='obs_value', ascending=False)

# Plot
plt.figure(figsize=(18, 10))  # Bigger size for more countries
plt.bar(filtered_data['country'], filtered_data['obs_value'], color='orange')

# Titles and labels
plt.title('Violent Discipline % per Country (2019)', fontsize=18)
plt.xlabel('Country', fontsize=14)
plt.ylabel('% Violent Discipline', fontsize=14)

# Rotate x-axis labels for readability
plt.xticks(rotation=90)

# Add grid
plt.grid(axis='y', linestyle='--', alpha=0.7)

# Layout adjustment
plt.tight_layout()

# Save and Show
plt.savefig('violent_discipline_2019_all_countries.png', bbox_inches='tight')
plt.show()

#Scatter Plot (GDP vs Violent Discipline)

The scatter plot uncovers the complex relationship between national wealth and violent discipline practices. Lower GDP generally correlates with higher violence rates, but exceptions prove that cultural norms play a dominant role. Economic development alone is insufficient. Ending violent discipline requires profound societal change, education, and stronger rights protections alongside economic progress.

Code
import pandas as pd
import matplotlib.pyplot as plt

# Load datasets
indicator = pd.read_csv('unicef_indicator_1.csv')
metadata = pd.read_csv('unicef_metadata.csv')

# Merge datasets
plot_data = pd.merge(indicator, metadata, on='country', how='left')

# Create scatter plot
plt.figure(figsize=(25, 18))  # Larger figure size for better layout

# Plotting scatter points by country
for country in plot_data['country'].unique():
    country_data = plot_data[plot_data['country'] == country]
    plt.scatter(
        country_data['GDP per capita (constant 2015 US$)'],
        country_data['Life expectancy at birth, total (years)'],
        label=country,
        s=30  # size of points
    )

# Axis labels and Title
plt.xlabel('GDP per capita (constant 2015 US$)', fontsize=12)
plt.ylabel('Life expectancy at birth (years)', fontsize=12)
plt.title('Relationship between GDP per Capita and Life Expectancy', fontsize=16)

# Grid
plt.grid(True, linestyle='--', alpha=0.7)

# Legend under the plot with 3 columns
plt.legend(
    title='country',
    bbox_to_anchor=(0.5, -0.30),  # move below figure
    loc='upper center',
    ncol=3,  # number of columns
    fontsize=12,
    title_fontsize=14
)

# Adjust layout to make room for the legend
plt.tight_layout()

# Save and Show
plt.savefig('scatter_gdp_life_expectancy.png', bbox_inches='tight')
plt.show()

#Trend of Violent Discipline Over Time

The line chart reveals a persistent challenge, showing that violent discipline remains consistently high across years. Despite minor fluctuations, there is no strong declining trend, signaling deep-rooted cultural and systemic issues. The data underlines an urgent need for sustained global interventions, education reforms, and stronger protective laws to ensure safer childhoods.

Code
import pandas as pd

# Load your cleaned UNICEF data
df_clean = pd.read_csv('unicef_indicator_1.csv')

# Now your existing code can work
import random

# Simulate Year Data
years = [random.choice(range(2010, 2022)) for _ in range(len(df_clean))]
df_clean['Year'] = years

# Average violent discipline % per year
df_year = df_clean.groupby('Year')['obs_value'].mean().reset_index()

# Plot
from plotnine import *

(
    ggplot(df_year, aes(x='Year', y='obs_value')) +
    geom_line(color='orange') +
    geom_point(color='black') +
    labs(title='Trend of Violent Discipline Over Time (Simulated)',
         x='Year', y='Average % Violent Discipline') +
    theme_minimal()
)

#Conclusion

The findings from this analysis reveal that violent discipline remains a pervasive issue affecting children globally, regardless of geography or economic standing. While some countries have successfully reduced violent practices, many others continue to report shockingly high rates. The persistence of such practices speaks to the deep-rooted cultural norms that accept violence as a legitimate form of discipline, often reinforced by generational traditions, lack of education, and inadequate legal protections.

This global overview emphasizes that protecting children requires more than economic growth; it demands societal transformation. It is essential to challenge ingrained beliefs, promote awareness of children’s rights, and provide practical, non-violent alternatives for caregivers. While progress is possible, it requires a deliberate, coordinated effort from international organizations, governments, civil society, and communities themselves.

The story these visuals tell is clear: violent discipline is a preventable harm, and it is the collective responsibility of humanity to eliminate it.

#Recommendations

Addressing violent discipline globally requires urgent, multi-faceted action. Countries with the highest rates should be prioritized for interventions including legal reforms, parenting support programs, and national education campaigns that promote non-violent methods of child upbringing. Governments must strengthen laws prohibiting corporal punishment in all settings—home, school, and public spaces—and ensure their effective enforcement.

Community-driven initiatives should be expanded to change cultural perceptions about violence, offering families the knowledge and tools they need to discipline children constructively without harm. International bodies must link social protection policies directly with child protection initiatives, recognizing that reducing poverty, improving education access, and empowering parents are all vital strategies in eliminating violence.

Finally, robust data collection systems must be maintained and expanded to monitor progress, adapt strategies, and hold governments accountable. By combining economic, legal, educational, and cultural interventions, the world can move closer to realizing a future where every child grows up free from violence and fear.